<script setup>
defineProps({
  title: {
    required: true,
    type: String
  }
})
</script>

<template>
  <div>
    <el-card class="page-container">
      <template #header>
        <div class="header">
          <span style="display: flex; align-items: center">
            <slot name="icon"></slot>
            <div>{{ title }}</div>
          </span>
          <div class="extra">
            <slot name="extra"></slot>
          </div>
        </div>
      </template>
      <div class="search">
        <slot name="search"></slot>
      </div>
      <div class="body">
        <slot name="body"></slot>
        <slot name="footer"></slot>
      </div>
    </el-card>
  </div>
</template>

<style scoped lang="scss">
.page-container {
  min-height: 100%;
  box-sizing: border-box;

  .header {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
}

.inp {
  display: block;
}

.extra {
  display: flex;
}

.search {
  display: flex;
  align-items: center;
}
.search ::v-deep .el-input {
  width: 200px;
  height: 30px;
  margin: 0 15px;
}

.body {
  padding: 10px;
}

.body ::v-deep .el-pagination {
  padding: 20px 10px 0 10px;
}
</style>
